/**
 * 局部中间件
 */
const express = require("express")

const app = express()

app.get("/user/login", (req, res, next) => {
  // 此处在路由/user/login中加上了局部中间件，第二个参数和第三个参数都是中间件，这个中间件可以加很多层
  // 但要记得执行next
  console.log("this is a local middleware")
  next()
}, (req, res, next) => {

  console.log("this is also a local middleware")
  next()

}, (req, res) => {

  res.send("user login");
})

app.listen(4000, () => {
  console.log("server start")
})
